import api from './index'
import { axios } from '@/utils/request'
import Qs from 'qs'

export function importXls(parameter) {
  return axios({
    url: api.ImportXls,
    method: 'post',
    params: parameter
  })
}

export function exportXls(parameter) {
  return axios({
    url: api.ExportXls,
    method: 'post',
    params: parameter
  })
}
export function studentSave(parameter) {
  return axios({
    url: api.StudentSava,
    method: 'post',
    data: Qs.stringify(parameter)
  })
}
export function entranceSave(parameter) {
  return axios({
    url: api.EntranceSava,
    method: 'post',
    data: Qs.stringify(parameter)
  })
}
export function studentDel(parameter1, parameter2) {
  return axios({
    url: `${api.StudentDel}?tablename=${parameter2}`,
    method: 'post',
    data: parameter1
  })
}
export function studentList(parameter) {
  return axios({
    url: api.StudentList,
    method: 'get',
    params: parameter
  })
}
export function studentInfo(parameter) {
  return axios({
    url: api.StudentInfo,
    method: 'get',
    params: parameter
  })
}
export function studentImg(parameter) {
  return axios({
    url: api.StudentImg,
    method: 'get',
    params: parameter
  })
}
export function uploadImage(parameter1, parameter2) {
  return axios({
    url: `${api.UploadImage}?tablename=${parameter2.tablename}&signname=${parameter2.signname}`,
    method: 'post',
    data: parameter1
  })
}
export function getImg(parameter) {
  var a = process.env.VUE_APP_API_BASE_URL
  return a + parameter
}
export function exportStudentInfo(parameter) {
  return axios({
    url: api.ExportStudentInfo,
    method: 'post',
    params: parameter
  })
}
